import re
with open('test.txt', 'r', encoding='utf-8') as f:
    text = f.read()
#老师答案
result = re.sub('</?\w+>','',text)
#我的答案
result = re.sub('<.{1,4}>','',text)
print('过滤后的文档为：%s'% result)





